/**
 * @class refrigeratory.pn_portal
 * @extends Ext.Panel
 *
 * 常用任务面板模块
 *
 * @author    Maple
 * @copyright (c) 2009, refrigeratory
 * @date      28. February 2011
 * @version   0.1
 * @revision  0.1
 *
 */

// create namespace
Ext.ns('refrigeratory');
refrigeratory.SITE_URL = '';

/**
 * Creates new refrigeratory.pn_portal
 * @constructor
 * @param {Object} config A config object
 */
refrigeratory.pn_portal = Ext.extend(Ext.Panel, {
    
    url: refrigeratory.REQUEST_URL
    ,id: 'pn_portal'
    // {{{
    ,
    initComponent: function() {
        // hard coded config (it cannot be changed while instantiating)
        // {{{
        var config = {
        //	title: this.titleText
        	layout:'fit'
        	,items:this.createPortal()
        	// 使this.tools对整个portal所在的panel来说无效
        	,tools: []
        }; // eo config object

        // apply config
        Ext.apply(this, Ext.apply(this.initialConfig, config));
        // }}}

        // call parent
        refrigeratory.pn_portal.superclass.initComponent.apply(this, arguments);

        // parent call post-processing, e.g. install event handlers

    } // eo function initComponent
    // }}}
    // {{{
    ,
    onRender: function() {

        // parent call pre-processing

        // call parent
        refrigeratory.pn_portal.superclass.onRender.apply(this, arguments);

        // parent call post-processing, e.g. install event handlers on rendered components

    } // eo function onRender
    // }}}
    
    // private 生成this.portal
    ,createPortal: function(){
        this.portal = {
        	xtype:'portal',
            region:'center',
            margins:'0 0 0 0',
            items:[{
                columnWidth:.33,
                style:'padding:10px 0 10px 10px',
                items:[{
                    title: "欢迎",
                    items:this.createPn()
                }]
            }]
        };
        return this.portal;
    }
    
    // private
    ,createPn: function(){
    	var pn = new Ext.Panel({
    		title:''
    		,html:'欢迎使用飞信信息管理系统！'
    		,height:160
    		,bodyStyle:'padding:10px;'
    	});
    	return pn;
    }
}); // eo extend

// register xtype
Ext.reg('pn_portal', refrigeratory.pn_portal);
// eof
